PowerTCP SSH and SFTP for .NET
Read(String[],Object) Method




An array of delimiters to search for. If null, the socket is read until a timeout occurs or the server closes the connection.
Optional parameter useful for passing state information to the Data event in a COM environment.
Receives data until a delimiter is found.
Syntax
'Declaration
 
Public Overloads Function Read( _
   ByVal delimiters() As String, _
   ByVal state As Object _
) As Data
'Usage
 
Dim instance As SessionStream
Dim delimiters() As String
Dim state As Object
Dim value As Data
 
value = instance.Read(delimiters, state)
public Data Read( 
   string[] delimiters,
   object state
)
public: Data* Read( 
   string*[]* delimiters,
   Object* state
) 
public:
Data^ Read( 
   array<String^>^ delimiters,
   Object^ state
) 

Parameters

delimiters
An array of delimiters to search for. If null, the socket is read until a timeout occurs or the server closes the connection.
state
Optional parameter useful for passing state information to the Data event in a COM environment.

Return Value

A Data object encapsulating the received data.
Remarks

This method blocks until a delimiter is found, the timeout period expires, or the server closes the connection. If the method times out, all received data will be returned, and an exception will NOT be thrown. Instead, the returned Data.Delimiter will be null, indicating no delimiter was not found.

If Ssh.ThreadingModel is ThreadingModel.ApartmentAsync, this method immediately returns a null value after starting a worker thread that executes the operation asynchronously. The Ssh.Data event is raised containing the result upon completion, or the Ssh.Error event is raised if an exception is thrown. This method is not threadsafe.

See Also

Reference

SessionStream Class
SessionStream Members
Overload List


PowerTCP SSH and SFTP for .NET Documentation Version 7.0
© 2023 Dart Communications. All Rights Reserved.
Send comments on this topic